import org.jsoup.Connection;
import org.jsoup.Jsoup;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Created by Administrator on 2014/3/25.
 * Time: 20:02
 */
public class demo3_jsoup {
    public static void main(String[] args) {
        Map<String, String> cookiemap=null;
        Map<String,String>  datamap=null;
        cookiemap = new HashMap<String, String>();
//        Connection connection2  = Jsoup.connect("http://rate.taobao.com/user-rate-0.htm");
        Connection connection2  = Jsoup.connect("http://rate.taobao.com/user-rate-1763577710.htm");
        connection2.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
        connection2.header("Accept-Encoding","gzip, deflate");
        connection2.header("Accept-Language","zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3");
        connection2.header("Connection","keep-alive");
        connection2.header("Referer","http://oa.raycloud.com/login.php");
        connection2.header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0");
        cookiemap.put("PHPSESSID","kvs39vbcfs3gc89g5ppuiese53");
        connection2.cookies(cookiemap);
//        connection2.data(datamap);

        Long l1=System.currentTimeMillis();
        try {
            connection2.post();
        } catch (IOException e) {
            e.printStackTrace();
        }
        Connection.Response response2 = connection2.response();


//            System.out.println(response2.parse());
            HashMap<String,String> map= (HashMap<String, String>) response2.cookies();
            Set<String> set=map.keySet();
        for (String s : set) {
            System.out.println(s+"==>"+map.get(s));
        }
            System.out.println();

        Long l2=System.currentTimeMillis()-l1;
        System.out.println("处理时间"+l2+"ms");
    }
}
